package com.example.demo.mapper;

import com.example.demo.entity.PmAdjustManager;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface PmAdjustManagerMapper extends BaseMapper<PmAdjustManager> {
    @Select("select * from pm_adjust_manager where employee_id = #{employeeId} ")
    List<PmAdjustManager> get(Long employeeId);

//    @Select("select * " +
//            "from pm_adjust_manager WHERE modify_time in " +
//            "(select max(modify_time) from pm_adjust_manager group by employee_id) " +
//            "AND modify_time <= #{endDate} " +
//            "AND company like #{company} " +
//            "ORDER BY modify_time DESC LIMIT 1")
@Select("select * " +
        "from pm_adjust_manager WHERE id in " +
        "(select max(id) from pm_adjust_manager where start_time <= #{endDate} and start_time >= #{startDate} and company like #{company} group by employee_id) ")
    List<PmAdjustManager> excel(String startDate, String endDate, String company);
}




